#ifndef _DATA_PROC_H
#define _DATA_PROC_H

#include <pthread.h>
void *threadFunc_dataProc(void *arg);

extern int flagDataProcRunning;
extern pthread_t dataProc_ThreadHandle;

void getQueryResult(int timeIn,char * devId,char * ipPort,char * buffOut, int * lenOut);

typedef struct _paramRecv
{
   int timeRecv;
   char devId[40];
   char snapshot[40];
}paramRecv;

typedef struct _paramSend
{
   int timeRecv;
   unsigned short type;
   unsigned short lenMoney;
   char money[32];
}paramSend;


void getQueryParam(char * buff, int buffLen, paramRecv * paramResult);

void getSendParam(char * buff, int buffLen, paramSend * paramResult);

void updateIp_MySql(int timeStamp,char * devId,unsigned int ipAddr,unsigned short port,int fd);

void updateStatus_MySql(char * devId, char * snapshot);


#endif
